package com.yuanfeng.activity.controller;

import com.yuanfeng.activity.dto.ReductionPolicyBaseAddDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName ActivityReductionPolicyGoodsController
 * @Description 满减赠折商品
 * @Author hyq
 * @Date 2023/7/13 10:56
 * @Version 1.0
 **/
@RestController
@RequestMapping("activity/reductionPolicyGoods")
public class ActivityReductionPolicyGoodsController extends BaseController {


    /**
     * 失效满减赠折活动
     *
     * @param param
     * @return
     */
    @PostMapping(value = "/base/invalidate")
    public ResponseResult invalidateManjianzengzheBase(@RequestBody Map<String, Object> param) {
        ResponseResult result = activityReductionPolicyGoodsService.invalidateManjianzengzheBase(param);
        return result;

    }


    /**
     * 删除满减赠折活动
     *
     * @param param
     * @return
     */
    @PostMapping(value = "/base/delete")
    public ResponseResult deleteManjianzengzheBase(@RequestBody Map<String, Object> param) {
        ResponseResult result = activityReductionPolicyGoodsService.deleteManjianzengzheBase(param);
        return result;
    }


    /**
     * 查看赠折活动详情
     *
     * @param param
     * @return
     */
    @PostMapping("/base/goods/query/list")
    public ResponseResult queryGoodsDetailList(@RequestBody Map<String, Object> param) {
        ResponseResult result = activityReductionPolicyGoodsService.queryGoodsDetailList(param);
        return result;
    }


    /**
     * 查询满减赠折活动列表
     *
     * @param param
     * @return
     */
    @PostMapping(value = "/base/query/list")
    public ResponseResult queryReductionPolicyBaseList(@RequestBody Map<String, Object> param) {
        ResponseResult result = activityReductionPolicyGoodsService.queryReductionPolicyBaseList(param);
        return result;
    }


    /**
     * 删除活动商品
     *
     * @param param
     * @return
     */
    @PostMapping("/base/goods/delete")
    public ResponseResult deleteGoods (@RequestBody ReductionPolicyBaseAddDTO param) {
        ResponseResult result = activityReductionPolicyGoodsService.deleteGoods(param);
        return result;
    }


    /**
     * 新增满减赠折活动
     *
     * @param param
     * @return
     */
    @PostMapping("/base/add")
    public ResponseResult addManjianzengzheBase(@RequestBody ReductionPolicyBaseAddDTO param) {
        ResponseResult result = activityReductionPolicyGoodsService.addManjianzengzheBase(param);
        return result;
    }

    /**
     * 新增活动商品
     *
     * @param param
     * @return
     */
    @PostMapping("/base/goods/add")
    public ResponseResult addGoods (@RequestBody ReductionPolicyBaseAddDTO param) {
        ResponseResult result = activityReductionPolicyGoodsService.addGoods(param);
        return result;
    }


}
